package com.bohua.intermediary.controller;

import com.bohua.intermediary.common.Lay;
import com.bohua.intermediary.common.Msg;
import com.bohua.intermediary.entity.SysRoleResources;
import com.bohua.intermediary.service.SysRoleResourcesService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
/**
 * 控制器
 * @author qian
 * @email 1415261159@qq.com
 * @date 2019/01/19
 */
@Controller
@RequestMapping("/sysRoleResources")
public class SysRoleResourcesController {
    @Resource
    private SysRoleResourcesService sysRoleResourcesService;

    @RequestMapping
    public String sysRoleResources(){
        return "sysRoleResources/sysRoleResources";
    }
    @RequestMapping("/add")
    public String add(){
        return "sysRoleResources/addSysRoleResources";
    }

    @RequestMapping("/update")
    public String update(){
        return "sysRoleResources/updateSysRoleResources";
    }

    @RequestMapping("/getSysRoleResourcess")
    @ResponseBody
    public Lay getSysRoleResourcess(SysRoleResources sysRoleResources,Integer page,Integer limit){
        return sysRoleResourcesService.getSysRoleResourcess(sysRoleResources,page,limit);
    }
    @RequestMapping("/addSysRoleResources")
    @ResponseBody
    public Msg addSysRoleResources(SysRoleResources sysRoleResources){
        return sysRoleResourcesService.addSysRoleResources(sysRoleResources);
    }

    @RequestMapping("/updateSysRoleResources")
    @ResponseBody
    public Msg updateSysRoleResources(SysRoleResources sysRoleResources){
        return sysRoleResourcesService.updateSysRoleResources(sysRoleResources);
    }

    @RequestMapping("/delSysRoleResources")
    @ResponseBody
    public Msg delSysRoleResources(SysRoleResources sysRoleResources){
        return sysRoleResourcesService.delSysRoleResources(sysRoleResources);
    }
}
